<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 200px;
            background: red;
        }
    </style>
</head>
<body>
    <div></div>
    <script>
        // 封装函数可以批量设置样式
        function setStyle(dom){
            document.querySelector(dom).style.height = "200px"
        }  
        setStyle("div")
    </script>
</body>
</html>